// 主界面
;
define(function(require, exports, module) {
	'use strict';
	var util = require("util");
	var base = require(CONFIG.BasePath + "js/enterprise/base");
	var router = require("../hash/pageRouter");
	var constant = require("constant");
	var css_pickup = require("./accountEvaluateDetail.css");
	var css_raty = require(CONFIG.BasePath + "js/jQuery-raty/css/jquery.raty.css");
	var financeId;
	var databind = require("databind");
	var tools = require("tools");

	var init = function(page) {
		financeId = page.params.financeId;
		inquireFinanceEvaluate();
		router.init();
		initEvent();
	};

	var initEvent = function() {
		$('.financeRaty').raty({
			path: function() {
				return CONFIG.BasePath + "js/jQuery-raty/img/";
			},
			score: function() {
				return 5;
			}
		});
		if (base.getData("sid") == null) {
			location.href = "../login/login.html";
		}

		//点击项目基本详情financeDetail
		$(".financeDetail").unbind("click").click(function() {
			router.route("account/accountDetail.html?financeId=" + financeId, true);
		});
	};

	//新增评价
	var inquireFinanceEvaluate = function() {
		base.fnAjax({
			action: "inquireFinanceEvaluate.json",
			async: false,
			oData: {
				financeId: financeId
			}, //传递参数
			fnSuccess: function(data) {
				if (data.status == 200) {
					databind.fillForm($("#accountEvaluateDetail"), data.datas[0]);
					databind.disableInput($("#accountEvaluateDetail"));
				} else {}
			}
		});
	};

	return {
		init: init
	};
});